﻿namespace Anmlz.Auth
{
    public interface ICryptService
    {
        bool CheckPassword(string candidate, string hashed);
        string HashPassword(string password);

    }
    public class CryptService : ICryptService
    {
        public bool CheckPassword(string candidate, string hashed)
        {
            return BCrypt.CheckPassword(candidate, hashed);
        }

        public string HashPassword(string password)
        {
            return BCrypt.HashPassword(password, BCrypt.GenerateSalt(12));
        }
    }
}
